package com.tjetc.service.impl;

import com.tjetc.domain.Admin;
import com.tjetc.mapper.AdminMapper;
import com.tjetc.service.AdminService;
import com.tjetc.utils.Db;
import com.tjetc.vo.Result;

public class AdminServiceImpl implements AdminService {
    AdminMapper adminMapper= Db.getMapper(AdminMapper.class);
    /**
     * 管理员登录
     * @param admin
     * @return
     */
    @Override
    public Result login(Admin admin) {
        //查询
        Admin admin1 =adminMapper.get(admin);
        //判断
        if (admin1!=null){
            return new Result(200,"登陆成功",admin1);
        }
        return new Result(500,"登录失败,账户或密码错误",null);
    }
}
